<%@ page language="java" import="java.util.*,view.ViewOc_Boat,tools.PageBeanPlus,form.BoatForm" pageEncoding="utf-8"%>
<%
List<ViewOc_Boat> list=(List<ViewOc_Boat>)request.getAttribute("list");
PageBeanPlus pagebeanplus=(PageBeanPlus)request.getAttribute("pagebeanplus");
BoatForm boatform=(BoatForm)request.getAttribute("boatform");
 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>adminindex</title>
<script>
function edit_me(id)
{
	//window.alert(id);
	//window.alert("新增数据");
		
		 var obj=id;
		 document.getElementById("id").value=id;
		 var url="<%=request.getContextPath()%>/admin_load_boat.do?method=admin_load_oc_boat&id="+id+"&v="+Math.random();
		 //var returnvalue= window.showModalDialog(url,obj,
	  	//"dialogWidth=850px;dialogHeight=600px;toolbar=no;menubar=no;scrollbars=no;resizable=no;location=no;status=no");
		 //window.location.replace(location.href);
		    document.getElementById("form1").action=url;
			document.getElementById("form1").submit();
	}
function del_me()
	{
		var obj=window.confirm("确实要删除这些数据么?")
		var c_box=document.getElementsByName("c_box");
		//window.alert(c_box.length);
		var c_box_check="";
		for(var i=0;i<c_box.length;i++)
		{
			if(c_box[i].checked==true)
			{
				//window.alert(c_box[i].value);
				c_box_check=c_box[i].value+","+c_box_check;
				}
			}
		
		if(obj==true)
		{
			window.alert("提交表单删除数据");
			//window.alert("c_box_check="+c_box_check);
			document.getElementById("form1").action="<%=request.getContextPath()%>/admin_delete_boat.do?method=admin_delete_oc_boat";
			document.getElementById("id").value=c_box_check;
			document.getElementById("form1").submit();
			
			}
		
		}
function add_me()
{
	var url="<%=request.getContextPath()%>/admin_add_boat.do?method=admin_add_oc_boat&v="+Math.random();
	document.getElementById("form1").action=url;
	document.getElementById("form1").submit();
	}
</script>
<link href="../../css/style.css" rel="stylesheet" type="text/css" />
<style>
body{
	background-color: #EAEBE3;
}
</style>
</head>
<body>


<div class="admin_nei">


<div class="xge">
  <!--<div class="xgetitle"><img src="../../images/admin_38.jpg" alt="" /></div> -->
  <div class="gt">
    
    <form id="form1" name="form1" method="post" action="<%=request.getContextPath()%>/admin_search_boat.do?method=admin_search_oc_boat" >
    <input type="hidden" id="id" name="id" />
    <input type="hidden" name="currentpage" id="currentpage" value="<%=boatform.getCurrentpage() %>" ></input>
    </form>
    
    <div class="gtt">
   <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a0a297">
     <tr>
       <td width="8%" align="center" bgcolor="#eaebe3">选择</td>
       <td width="9%" align="center" bgcolor="#eaebe3">排序</td>
       <td width="11%" align="center" bgcolor="#eaebe3">操作</td>
       <td width="58%" bgcolor="#eaebe3">名称</td>
       </tr>
   </table>
   <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#D9D9D9" id="admintxt">
     <%for(int i=0;i<list.size();i++)
     { %>
     <tr>
       <td width="8%" align="center" bgcolor="#FFFFFF"><input value="<%=list.get(i).getKey()%>"  type="checkbox" name="c_box" id="c_box" /></td>
       <td width="9%" align="center" bgcolor="#FFFFFF"><%=list.get(i).getId() %></td>
       <td width="11%" align="center" bgcolor="#FFFFFF"><span style="cursor:pointer" onclick="edit_me(<%=list.get(i).getKey()%>)">修改</span></td>
       <td width="58%" bgcolor="#FFFFFF"><%=list.get(i).getOc_boatname() %></td>
     </tr>
     <%
     } %>
     <tr>
       <td colspan="5" align="center" bgcolor="#FFFFFF">
       <input type="button" name="button" id="button" value="删除" onclick="del_me()"/>
         <input type="button" name="button2" id="button2" value="添加" onclick="add_me()" /></td>
     </tr>
     <tr>
       <td colspan="5" align="center" bgcolor="#FFFFFF">  <%=pagebeanplus.getPagefoot() %></td>
       </tr>
   </table>
 </div>
    
    
    
    
    </div>
  
</div>
</div>







</body>
</html>
